<template>
    <el-select v-model="value" placeholder="请选择学院" @change="$emit('selectCollege', value)" filterable>
        <el-option v-for="college in colleges" :key="college.id" :label="college.name" :value="college.id" />
    </el-select>
</template>
<script>
import { colleges } from '@/api/college.js'
export default {
    data() {
        return {
            colleges: [],
            value: null
        }
    },
    created() {
        this.fetchColleges()
    },
    methods: {
        fetchColleges() {
            colleges().then(res => {
                this.colleges = res.data
            })
        },
    }
}
</script>